home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / MacStarter (THINK C 5.0⁄6.0) / globals-MacStarter.h < prev    next >
Text File  |  1992-10-10  |  2KB  |  74 lines

  1. /* MacStarter is a shell for simple Macintosh applications shell written in
  2.    THINK C, with some small use of its object-oriented features.
  3.    The whole system is described in a README file that should be in the 
  4.    same folder with this file, which has full details on the stuff
  5.    defined here.
  6. */
  7.  
  8. extern EventRecord gEvent;
  9. extern int gClickCount;
  10. extern Rect gWindowRect;
  11. extern Handle gMenuBar;
  12. extern long gEventWaitTime;
  13.  
  14. typedef enum {
  15.    hasVScroll = 1,
  16.    hasHScroll = 2,
  17.    hasGoAway = 4,
  18.    hasZoom = 8,
  19.    hasGrow = 16 }
  20.  WindowFeatures;
  21.  
  22. class xWindow : indirect {
  23.  protected:
  24.    short features;
  25.    int topScrollOffset,bottomScrollOffset;
  26.    int leftScrollOffset,rightScrollOffset;
  27.    int minH, maxH, minV, maxV;
  28.    int hLinesPerPage,vLinesPerPage;
  29.    ControlHandle hScroll,vScroll;
  30.    WindowPtr theWindow;
  31.    xWindow *nextWindow;
  32.  public:
  33.    virtual void OpenInRect(Str255 title, int left, int top, int right, int bottom);
  34.    void OpenFullScreen(Str255 title);
  35.    void Open(Str255 title);
  36.    virtual short Close(void);
  37.    void doEvent(void);
  38.    static int Window2XWindow(WindowPtr win, xWindow** xWin);
  39.  protected:
  40.    virtual void SetDefaults(void);
  41.    void GetTitle(Str255 name);
  42.    void SetTitle(Str255 name);
  43.    void ForceRedraw(Rect *badRect);
  44.    int GetHVal(void);
  45.    int GetVVal(void);
  46.    void SetHVal(int val);
  47.    void SetVVal(int val);
  48.    int GetHMax(void);
  49.    int GetVMax(void);
  50.    void SetHMax(int val);
  51.    void SetVMax(int val);
  52.    void SetHLinesPerPage(short hLines);
  53.    void SetVLinesPerPage(short vLines);
  54.    virtual void doKey(char ch);
  55.    virtual void doContentClick(Point localPt);
  56.    virtual void adjustToNewSize(void);
  57.    virtual void doRedraw(Rect* badRect);
  58.    virtual void doActivate(int active);
  59.    virtual void doHScroll(int dh);
  60.    virtual void doVScroll(int dv);
  61.  private:
  62.    ~xWindow(void);
  63.    void doBasicOpen(Str255 title, int left, int top, int right, int bottom);
  64.    void doClick(Point globalPt);
  65.    void doDrag(Point globalPt);
  66.    void doZoom(short partNum);
  67.    void doGrow(Point globalPt);
  68.    void doUpdate(void);
  69.    static pascal void ContinuousScroll(ControlHandle theControl, short partNum);
  70.  };
  71.  
  72.  
  73. extern xWindow *xWindowList;
  74.